Repository navigation
feat(lint): warn when a select option colour renders neutral on the option badge - #37986
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
…adge Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibx7DSQZnugnuX8CpCM
… changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibx7DSQZnugnuX8CpCM
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibx7DSQZnugnuX8CpCM
📓 Docs Drift CheckThis PR changes 1 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6ae06014813bce6f40572551a0486239cda05d39 && git checkout 6ae06014813bce6f40572551a0486239cda05d39
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 57ab08760c7ffd506454864b22c0ce7d9a614164 e3423ab81d3143b1c6c804fcfff8c8c277b73dda && git checkout -B drift-repro 57ab08760c7ffd506454864b22c0ce7d9a614164 && git merge --no-ff e3423ab81d3143b1c6c804fcfff8c8c277b73dda
node scripts/docs-audit/affected-docs.mjs --json 57ab08760c7ffd506454864b22c0ce7d9a614164
|
Requested by Tesla · project thread
Fixes #37435
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
field/option-color-renders-neutral(lintOptionColorsinpackages/lint/src/data-model-rules.ts). It warns on a select optioncolorthe option badge does not paint: anything that is not one of the nine palette families (gray red orange yellow green blue indigo purple pink, lowercase, asBADGE_COLOR_MAPmatches them) and not#+ 3 or 6 hex digits. The warning names the option; the fix line names the spelling the value already points at (lowercase family, the hex with its#, the hex without alpha digits), otherwise the families and the hex form. It never maps a colour name to a family.SelectOption.colorstaysz.string(), and charts and gantt bars paint a CSS colour name.AUTHORING_RULESastier: 'advisory', onos validate/os build/os lint, and on the runtime publish gate forobjectandobject_extensionwrites, where findings ride back as 2xxadvisories(the save door Studio, REST/metaand MCP authors share). Judges object fields, object-extension fields, picklists and picklist extensions; picklists are CLI-only becausepicklistis not runtime-creatable.os explain field/option-color-renders-neutralentry inrule-explanations.ts, with the measured per-surface reading.FIELD_OPTION_COLOR_RENDERS_NEUTRAL,OPTION_COLOR_FAMILIES,isBadgePaintableOptionColor,lintOptionColors, typeOptionColorPicklist.check:docs-transcript-drift).Tests
packages/lint/src/data-model-rules.option-color-37435.test.ts:tealwarned (rule, severity, path, where, fix names all nine families) andamber,Red, bare hex, alpha hex,rgb(),hsl(), leading-space hex all warned; every declared family and#abc/#14b8a6not warned; blank colour not judged; extension and picklist paths; all three commands; at the save doortealcomes back as an advisory with zero errors, andred/ a hex with none.Acceptance notes
RUNTIME_OBJECT_ADVISORY_VOLUME) stay fenced and untouched; that fence prices advisory VOLUME. Measured volume for this rule: 0 firings. Census of option-level colour literals: objectstack at 6e11ff2 (*.object.ts, picklists, extensions; non-test) is every one a family name or a 6-digit hex; the only out-of-family names (teal,amber, 9 sites) are OBJECT-levelcolor, which this rule does not read. hotcrm at 08a7451: 170 colour literals, all 6-digit hex. The one out-of-family option colour in the tree is a test fixture (ui/e2e/list-condition-row-35549.spec.ts:87,amber).@objectstack/lintcannot import@object-ui/fields(lint depends on spec only and runs in the kernel's save door), and a lint test reading the renderer source would need ascripts/cross-package-test-inputs.mjs+turbo.jsondeclaration outside this claim's file surface. The list is therefore spelled once in lint (OPTION_COLOR_FAMILIES) with a comment namingBADGE_COLOR_MAP; the shared home both sides could read is@objectstack/spec, left as an open question in the report rather than taken here.fieldPatches.userMessage(no.user-text.tscatalog); Studio renders the Englishmessage.Verification
pnpm --filter @objectstack/lint exec vitest run src/data-model-rules.option-color-37435.test.ts→ 9 passed.packages/lint/src/data-model-rules.ts(isBadgePaintableOptionColor, must match the renderer's reading),packages/lint/src/authoring-rules.ts(thelintOptionColorsentry and its door comment),packages/lint/src/rule-explanations.ts(the per-surface paragraph).Local readings (HEAD after the docs commit)
pnpm --filter @objectstack/lint test→ Test Files 244 passed (244), Tests 9816 passed, 5 skipped;pnpm --filter @objectstack/lint typecheck(tsc + test layer) green.isBadgePaintableOptionColorforced totrueon disk → 5 of 9 pins red (the out-of-family pin included); restored withgit checkout HEAD.node scripts/pm/overlap-check.mjs --branch=claude/project-thread-ciejge→VERDICT clean exit 0, feat(spec)!: action locations say what an action acts on #37929 (sharesrule-explanations.ts) merges cleanly.check:dual-build-cjs-loadsandcheck-plugin-teardown-shape --self-testare NOT MEASURED here (no full build; shallow clone) and are left to CI.Generated by Claude Code